import request from '@/utils/request'
// 查
export function fetchList(data) {
  return request({
    url:'/ptypes/selectbrands.action',
    method:'post',
    data
  })
}
// 删
export function deleteProductCate(data) {
  return request({
    url:'/ptypes/deleteByPrimaryKey.action',
    method:'post',
    data
  })
}
// 增
export function createProductCate(data) {
  return request({
    url:'/ptypes/insertSelective.action',
    method:'post',
    headers: {'Content-Type': 'multipart/form-data'},
    data
  })
}
// 改name
export function updateProductCate(data) {
  return request({
    url:'/ptypes/updateByPrimaryKeySelective.action',
    method:'post',
    data
  })
}
// 改图片
export function updateProductImg(data) {
    return request({
      url:'/tppicture/updateByPrimaryKey.action.action',
      method:'post',
      headers: {'Content-Type': 'multipart/form-data'},
      data
    })
  }

export function getProductCate(id) {
  return request({
    url:'/productCategory/'+id,
    method:'get',
  })
}

export function updateShowStatus(data) {
  return request({
    url:'/productCategory/update/showStatus',
    method:'post',
    data:data
  })
}

export function updateNavStatus(data) {
  return request({
    url:'/productCategory/update/navStatus',
    method:'post',
    data:data
  })
}

export function fetchListWithChildren() {
  return request({
    url:'/productCategory/list/withChildren',
    method:'get'
  })
}
